package com.request; /**
 * @author wzm
 * @create 2023-03-06 10:49
 */

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/*
* / 斜杠的作用：
* web中/表示的一种绝对路径
* /  被服务器解析时： http://ip:端口/工程名
*    @WebServlet("/rs06") =>  http://localhost:8080/javaweb06/rs06
*    /aa =>  http://localhost:8080/javaweb06/aa
*
* /  被浏览器解析
* /rs07 => http://localhost:8080
* 经常出现找不到的问题 这么写  /工程名/rs07
*通常给浏览器去使用/路径不要加上工程名，但是框架中不需要
*因为框架通常将项目名起做 /
*
* */

@WebServlet("/rs07")
public class RequestServlet07 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       //不用重写写代码 调用即可
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("rs07");
    }
}
